package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class NoteDemo {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入需要输入的数据：");
        FileOutputStream fo = new FileOutputStream("note.txt",true);
        String st;
        while (!"exit".equals(st = scan.nextLine())){
            byte[] data = st.getBytes(StandardCharsets.UTF_8);
            fo.write(data);
            fo.write('\n');

        }
    }
}
